package com.zyy.admin.service.impl;

import com.google.common.collect.Lists;
import com.zyy.admin.entity.LabelRuleTemplate;
import com.zyy.admin.entity.LabelUser;
import com.zyy.admin.repo.LabelRuleTemplateRepository;
import com.zyy.admin.repo.LabelUserRepository;
import com.zyy.admin.service.DataService;
import com.zyy.api.pojo.LabelInfo;
import com.zyy.api.pojo.LabelNewsInfo;
import com.zyy.api.service.feign.commonLabel.CommonLabelService;
import com.zyy.api.service.feign.fund.FundService;
import com.zyy.api.service.feign.index.IndexService;
import com.zyy.api.service.feign.industry.IndustryService;
import com.zyy.api.service.feign.stock.StockService;
import com.zyy.api.service.feign.topic.TopicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *@author zhangyangyang
 *@createTime 2023420 9:22
 *@description 数据服务接口
 */
@Service
public class DataServiceImpl implements DataService {

    @Autowired
    private FundService fundService;

    @Autowired
    private IndexService indexService;

    @Autowired
    private StockService stockService;

    @Autowired
    private TopicService topicService;

    @Autowired
    private CommonLabelService commonLabelService;

    @Autowired
    private IndustryService industryService;

    @Autowired
    private LabelRuleTemplateRepository labelRuleTemplateRepository;

    @Autowired
    private LabelUserRepository labelUserRepository;

    @Override public List<LabelRuleTemplate> getTemplateByUser(Integer userID) {
        return null;
    }

    @Override public LabelRuleTemplate getAvailableTemplate(Integer userId) {
        return null;
    }

    @Override public List<LabelUser> getAllUser() {
        return null;
    }

    @Override public List<LabelInfo> analysisFundLabel(LabelNewsInfo info) {
        return fundService.analysisLabel(info);
    }

    @Override public List<LabelInfo> getAllTypeLabel(LabelNewsInfo info) {
        List<LabelInfo> resultLabels = Lists.newArrayList();
        resultLabels.addAll(fundService.analysisLabel(info));
        resultLabels.addAll(indexService.analysisLabel(info));
        resultLabels.addAll(stockService.analysisLabel(info));
        resultLabels.addAll(topicService.analysisLabel(info));
        resultLabels.addAll(commonLabelService.analysisLabel(info));
        resultLabels.addAll(industryService.analysisLabel(info));
        return resultLabels;
    }

}
